
using System;
using System.ComponentModel;
using System.Data;
using System.Collections.Generic;

namespace PlacementManager
{
    
	public partial class VenueRequirementComponent
    {
		[DataObjectMethodAttribute(DataObjectMethodType.Select, false)]
		public List<VenueRequirement> SelectAllWVenueIdDivisionId(int VenueId, int DivisionId, string sortExpression)
		{
			List<VenueRequirement> listVenueRequirement = new List<VenueRequirement>();
			PlacementManager.DAL.VenueRequirement_DAL o = new PlacementManager.DAL.VenueRequirement_DAL();
			o.VenueId = VenueId;
            o.DivisionId = DivisionId;
			DataSet ds = o.SelectAllWVenueIdDivisionId();
			foreach (DataRow row in ds.Tables[0].Rows)
			{
				listVenueRequirement.Add(new VenueRequirement((int)row["VenueRequirementId"], (string)row["VenueRequirementName"], (string)row["VenueRequirementDescription"], (int)row["VenueId"], (int)row["DivisionId"]));			
			}
			if (sortExpression == string.Empty)
			{
				sortExpression = "DateCreated desc";
			}
			listVenueRequirement.Sort(new VenueRequirementComparer(sortExpression));
			return listVenueRequirement;
		}
	}
}
